package game;

import java.awt.Point;

import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;

public class Sudoku {

	private static final Logger log = Logger.getLogger(Sudoku.class);

	private SudokuMatrice tab;

	public Sudoku() {
		DOMConfigurator.configure("log4j.xml");
		tab = new SudokuMatrice();
		log.info(tab);
		resoudre();
		log.info(tab);
	}

	public void resoudre() {
		Point p = tab.nextEmptyPosition();
		while (!tab.estResolu()) {
			if (!tab.tryNextPosition(p.x, p.y)) {
				p = tab.previousEmptyPosition();
			} else {
				p = tab.nextEmptyPosition();
			}
		}
	}

	public static void main(String[] args) {
		new Sudoku();
	}
}
